<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('汇总报列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>年：</label>
                                <input type="text" name="year"/>
                            </li>
                            <li>
                                <label>月：</label>
                                <input type="text" name="month"/>
                            </li>
                            <li>
                                <label>总金额：</label>
                                <input type="text" name="totalMoney"/>
                            </li>
                            <li>
                                <label>现金：</label>
                                <input type="text" name="cash"/>
                            </li>
                            <li>
                                <label>充值：</label>
                                <input type="text" name="recharge"/>
                            </li>
                            <li>
                                <label>加班：</label>
                                <input type="text" name="workMore"/>
                            </li>
                            <li>
                                <label>会员：</label>
                                <input type="text" name="member"/>
                            </li>
                            <li>
                                <label>支出：</label>
                                <input type="text" name="payOut"/>
                            </li>
                            <li>
                                <label>工资支出：</label>
                                <input type="text" name="wages"/>
                            </li>
                            <li>
                                <label>纯利润：</label>
                                <input type="text" name="profit"/>
                            </li>
                            <li>
                                <label>思思收益：</label>
                                <input type="text" name="sisiMoney"/>
                            </li>
                            <li>
                                <label>马亮收益：</label>
                                <input type="text" name="mlMoney"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="store:money:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="store:money:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="store:money:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="store:money:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('store:money:edit')}]];
        var removeFlag = [[${@permission.hasPermi('store:money:remove')}]];
        var prefix = ctx + "store/money";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "汇总报",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'year',
                    title: '年'
                },
                {
                    field: 'month',
                    title: '月'
                },
                {
                    field: 'totalMoney',
                    title: '总金额'
                },
                {
                    field: 'payOut',
                    title: '其他支出'
                },
                {
                    field: 'wages',
                    title: '工资支出'
                },
                {
                    field: 'profit',
                    title: '纯利润'
                },
                {
                    field: 'sisiMoney',
                    title: '思思收益',
                    class:"danger"
                },
                {
                    field: 'mlMoney',
                    title: '马亮收益',
                    class:"warning"
                },
                {
                    field: 'cash',
                    title: '现金'
                },
                {
                    field: 'recharge',
                    title: '充值'
                },
                {
                    field: 'workMore',
                    title: '加班'
                },
                {
                    field: 'member',
                    title: '会员'
                },

                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>